package com.atguigu.tx;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Program Name: spring-annotation
 * Created by yanlp on 2022-03-30
 *
 * @author yanlp
 * @version 1.0
 */
@Service
public class UserService {
    @Autowired
    private UserDao userDao;

    @Transactional
    public void insert() {
        userDao.insert();
        System.out.println("插入完成....");
        int i = 1 / 0;
    }

}
